package com.lau.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;

import java.util.List;

/**
 * @author:Lau
 * @create: 2023-11-28 16:25
 * @Description: MVC配置类
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    /**
     *  注入参数解析器
     *
     * @return
     */
    @Bean
    public MethodArgumentResolver methodArgumentResolver() {
        return new MethodArgumentResolver();
    }

    /**
     * 参数解析器
     *
     * @param argumentResolvers
     */
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(methodArgumentResolver());
    }

}
